<div id="page_content">
    <h2><?= $this->t->_('Polls'); ?></h2>
    <?= $this->form ?>
</div>
<div id="sidebar">
    <a href="<?= ADMIN_URL . '/pages/modify/id/' . $this->section->id . '/a/new' ?>" class="sidebar_button add_button"><?= $this->t->_("New poll") ?></a>
</div>

<script type="text/javascript">
    $('#answer2-label').children().html('<a class="add_field"><span><?= $this->t->_('Add') ?></span></a>');
    $('#answer2-label').bind('click', function() {
        label = $(this).clone();
        label.children().html('<a class="remove_field"><span><?= $this->t->_('Remove') ?></span></a>');
        label.attr('id','answer3-label');
        element = $('#answer2-element').clone();
        element.children().val('');
        element.attr('id','answer3-element');
        element.children().attr('name','answer3[]');;
        $('fieldset#fieldset-answers').append(label).append(element);
    });
    $('#answer3-label').live('click', function() {
        $(this).next().remove();
        $(this).remove();
    });
</script>